import { createStore } from "vuex";

//创建状态
const state = {
  valueState: {
    value: '',
    name:'',
    key:'',
    rgb: [],
    hex:''
  },
  convent: {
    rgb: [],
    hex: '',
    tag: ''
  }
}
//创建actions
const actions = {

}
//创建mutataions
const mutations = {
  setValueState(state,date) {
    // data 是一个对象
    state.valueState = {...date}
  },
  setConvent(state,date) {
    state.convent = {...date}
  }
}

//创建store
const store = createStore({
  state,
  actions,
  mutations
})
//暴露出去
export default store
